import { eMenuType } from '@/interface/enum';
import { RouteRecordRaw } from 'vue-router';
import { iRouteMeta } from '@/interface/iRouteInfo';
import { getMenuImageUrl } from '@/utils/ui';

const mainHomeMeta: iRouteMeta = {
    menu_show: true,
    menu_type: eMenuType.MENU,
    normal: getMenuImageUrl('device.png'),
    // hover: getMenuImageUrl('room_hover.png'),
    parentPath: '',
    sort: 1,
    title: '设备管理',
    elements: [
        // {
        //   key: 'online_pay_refund',
        //   title: '退款功能',
        //   local_path: RouterConfig.Main.fullPath,
        //   menu_type: eMenuType.ELEMENT,
        // },
    ],
};

export const devices: RouteRecordRaw = {
    name: 'devices',
    path: '/devices',
    meta: mainHomeMeta,
    redirect: '/devices/zfn/zfn_info',
    component: () => import('@/layout/ContentLayout.vue'),
    children: [
        {
            path: '/devices/zfn',
            name: 'devices_list',
            // redirect: '/devices/list/zfn_info',
            meta: {
                menu_show: true,
                menu_type: eMenuType.MENU,
                title: '在线监测',
                parentPath: '/devices',
                sort: 1,
            },
            component: () => import('@/views/devices/list/index.vue'),
            children: [
                {
                    path: '/devices/zfn/zfn_info',
                    name: 'zfn_devices',
                    meta: {
                        menu_show: true,
                        menu_type: eMenuType.PAGE,
                        title: '设备列表',
                        parentPath: '/devices/zfn',
                        sort: 1,
                    },
                    component: () => import('@/views/devices/list/zfn/index.vue'),
                },
                {
                    path: '/devices/zfn/info',
                    name: 'devices_info',
                    meta: {
                        menu_show: false,
                        menu_type: eMenuType.PAGE,
                        title: '设备详情',
                        parentPath: '/devices/zfn',
                        sort: 1,
                    },
                    component: () => import('@/views/devices/detail/index.vue'),
                    children: [],
                },
            ],
        },
        {
            path: '/devices/biaoza',
            name: 'biaoza',
            // redirect: '/devices/list/zfn_info',
            meta: {
                menu_show: false,
                menu_type: eMenuType.MENU,
                title: '硅料表杂设备',
                parentPath: '/devices',
                sort: 1,
                auth: ['硅料表杂'],
            },
            component: () => import('@/views/devices/list/index1.vue'),
            children: [
                {
                    path: '/devices/biaoza/list',
                    name: 'biaoza_list',
                    meta: {
                        menu_show: false,
                        menu_type: eMenuType.PAGE,
                        title: '设备列表',
                        parentPath: '/devices/biaoza',
                        sort: 1,
                        auth: ['硅料表杂'],
                    },
                    component: () => import('@/views/devices/list/biaoza/index.vue'),
                },
                {
                    path: '/devices/biaoza/info',
                    name: 'biaoza_info',
                    meta: {
                        menu_show: false,
                        menu_type: eMenuType.PAGE,
                        title: 'ICPMS设备详情',
                        parentPath: '/devices/biaoza',
                        sort: 1,
                        auth: ['硅料表杂'],
                    },
                    component: () => import('@/views/controller_status/index.vue'),
                },
            ],
        },
    ],
};
